-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Astria named forks #59
base: main
Are you sure you want to change the base?
Conversation
"feeCollector": "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30", | ||
"eip1559Params": { "minBaseFee": 0, "elasticityMultiplier": 2, "BaseFeeChangeDenominator": 8 }, | ||
"sequencer": { | ||
"chainId": "sequencer-test-chain-0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this just used for genesis validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a justfile
in the dev
directory too which is used in our tutorials on running a local rollup. These are the default values needed if you follow the tutorial.
RollupId: &rollupId, | ||
SequencerChainId: fork.Sequencer.ChainID, | ||
SequencerStartBlockHeight: fork.Sequencer.StartHeight, | ||
SequencerStopBlockHeight: fork.Sequencer.StopHeight, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is stop height for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conductor uses stop height to determine when it needs to stop sending soft commits, wait for firm to reach the same level, and do an internal restart to re-fetch genesis info from geth which should have the next fork config
// this fork halts the chain | ||
if fork.Halt { | ||
return nil, status.Error(codes.FailedPrecondition, "Block cannot be created at halted fork") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does the chain un-halt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manual intervention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you link the doc for this? i'm unclear from the code as to how unhalting would work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes need to get some docs on this but basically the way it would work, such as the case of a sequencer network change, is you would pick some future height to halt at, update genesis to create a new named fork at that future height with halt
set to true
. Once the rollup reaches this height, it will stop. Then you do whatever manual steps you may need to do to prepare for the chain to migrate. e.g, updating conductor configs, taking any snapshots, etc. Then you update the geth genesis to set halt
at this fork to false
and set anything else you maybe did not know ahead of the halt, re-init and and start processing blocks.
params/astria_config.go
Outdated
) | ||
|
||
type AstriaForks struct { | ||
orderedForks []AstriaForkData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment saying these are in descending (?) order
return fmt.Errorf("fork %s: sequencer chain ID not set", fork.Name) | ||
} | ||
|
||
if fork.Sequencer.StartHeight == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can multiple forks on the same sequencer network have the same start height? i'm guessing not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes they can because we also track the RollupStartHeight
. Forks inherit the config from the previous fork and only need to define values that are changing. Sequencer StartHeight
only needs to be re-defined and be different in a fork if the network is changing or if the rollup wants to skip some sequencer blocks for some reason. Most typical forks will not change the sequencer config and it will carry forward from fork to fork.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah okay, i misunderstood the variable, this is the same sequencer start height as before, not where the fork starts
params/astria_config.go
Outdated
idx := sort.Search(len(c.orderedForks), func(i int) bool { | ||
return c.orderedForks[i].Height > height | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there are multiple forks higher than height
, this will return the overall highest, not the one directly higher than height
(since orderedForks
is descending by height)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep. will fix
params/astria_config.go
Outdated
func (c *AstriaForks) GetForkAtHeight(height uint64) AstriaForkData { | ||
idx := sort.Search(len(c.orderedForks), func(i int) bool { | ||
return c.orderedForks[i].Height <= height | ||
}) | ||
// no named fork at this height | ||
if idx == len(c.orderedForks) { | ||
return GetDefaultAstriaForkData() | ||
} | ||
return c.orderedForks[idx] | ||
} | ||
|
||
func (c *AstriaForks) GetNextForkAtHeight(height uint64) *AstriaForkData { | ||
idx := sort.Search(len(c.orderedForks), func(i int) bool { | ||
return c.orderedForks[i].Height > height | ||
}) | ||
if idx == len(c.orderedForks) { | ||
return nil | ||
} | ||
return &c.orderedForks[idx] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add tests for these?
params/astria_config.go
Outdated
if prefix != genesisPrefix { | ||
return fmt.Errorf("bridge address must have prefix %s", genesisPrefix) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it has to have the same prefix? what if the sequencer network was migrated and the prefixes are different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the address prefix is part of the AstriaSequencerConfig
so can be changed in the genesis config if sequencer network changes. I think genesisPrefix
is just leftover from the previous validation checks but the var name is confusing here. will update.
astria "named forks" config changes which will allow Forma migration and allow dusk-11 to resume blocks.